<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022/6/13
 * Time: 10:22
 */

include_once ('conn.php');
$sql =  "select * from `picture`";

$pd = mysqli_query($conn,$sql);

if(!$pd){
    die("数据库查询失败！！");
}


?>


<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<form action="">
    <table border="1" width="300px">


        <tr>
            <th>编号</th>
            <td>文件</td>
        </tr>

        <?php
//        if (isset($pd) == 0) {
//            echo "<tr align='center'><td >暂无数据</td></tr>";
//        } else {
            while ($hh = mysqli_fetch_assoc($pd)) {
                echo "<tr>";
                foreach ($hh as $item => $value) {

                    if ($item == 'tp') {
                        $value = "<img src='$value'>";
                    }

                    ?>
                    <td><?php echo $value ?></td>
                    <?php
                }
                echo "</tr>";
            }
//        }

        ?>

    </table>




</form>
</body>
</html>



